# build stage
FROM node:12.14.0 as build-stage

WORKDIR /usr/src/app

RUN apt-get update \
  && apt-get install -y --no-install-recommends git \
  && apt-get clean
COPY package*.json ./
RUN npm --registry https://registry.npm.taobao.org install
COPY . .
RUN npm run build

# production stage
FROM nginx:latest as production-stage
# RUN apt-get update && apt-get install -y vim curl
COPY --from=build-stage /usr/src/app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
CMD ["nginx", "-g", "daemon off;"]
